package com.yiwei.zhh.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.allen.library.SuperButton;
import com.yiwei.zhh.R;
import com.yiwei.zhh.constant.Const;
import com.yiwei.zhh.model.DealBeforeV3Model;
import com.yiwei.zhh.util.IdentityStepUtil;
import com.yiwei.zhh.util.Util;
import com.yiwei.zhh.view.FlowViewHorizontal;
import com.yiwei.zhh.view.V19FrameLayout;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2018/6/10.
 */

public class V3UpdateFinishActivity extends BaseActivity {
    @BindView(R.id.btn_back)
    ImageView btnBack;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.txt_right)
    TextView txtRight;
    @BindView(R.id.layout_title)
    V19FrameLayout layoutTitle;
    @BindView(R.id.step_view)
    FlowViewHorizontal stepView;
    @BindView(R.id.btn_reback)
    SuperButton btnReback;
    @BindView(R.id.btn_borrow)
    SuperButton btnBorrow;
    private Unbinder unbinder;
    private ArrayList<DealBeforeV3Model.DataBean.UplistsBean> SomeKeyData;
    private IdentityStepUtil stepUtil;
    private String bizType = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_update_finish_v3);
        initBar();
        unbinder = ButterKnife.bind(this);
        init();
    }

    private void init() {
        txtTitle.setText("");
        SomeKeyData = getIntent().getParcelableExtra(Const.KEY.SOME_IDENTITY_KEY);
        stepUtil = new IdentityStepUtil(this);
        stepUtil.setIdentityData(bizType, txtTitle, stepView, null, SomeKeyData);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        stepUtil = null;
        unbinder.unbind();
        unbinder = null;
    }

    @OnClick({R.id.btn_back, R.id.btn_reback, R.id.btn_borrow})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finish();
                break;
            case R.id.btn_reback:
                finish();
                break;
            case R.id.btn_borrow:
                Util.startActivity(this, SelectMoneyV3Activity.class);
                finish();
                break;
        }
    }
}
